public class Student{

   private final int studentID;       // a final variable must have no corresponding set method
   private String studentName;
   private String major;
   private double gpa;

   public Student(int id, String name, String theMajor, double theGpa){
    	studentID = id;
    	studentName = name;
    	major = theMajor;
        gpa = theGpa;
    }

    // Accessor or get methods:
    public int getID(){
    	return studentID;
    }

    public String getName(){
    	return studentName;
    }

    public String getMajor(){
    	return major;
    }

    public double getGPA(){
    	return gpa;
    }

    // Mutator or set methods:

    public void setStudentName(String theName){
    	studentName = theName;
    }

    public void setStudentMajor(String theMajor){
    	major = theMajor;
    }

    public void setStudentGPA(double theGPA) throws IllegalArgumentException{
      if(theGPA < 0 || theGPA > 4)
           throw new IllegalArgumentException("Error: Invalid GPA");
       gpa = theGPA;
    }
}